package com.example.module_device

import com.example.module_device.api.DeviceApiService
import com.example.module_device.api.MotorCircleNetModule
import com.example.module_device.model.DeviceEntityItem
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.flow
import kotlinx.coroutines.flow.flowOn
import javax.inject.Inject


class DeviceRepository @Inject constructor(){
    @Inject
    @MotorCircleNetModule.NoticeApi
    lateinit var apiService: DeviceApiService

    fun getDeviceAll() = flow {
        emit(apiService.getDeviceAll())
    }.flowOn(Dispatchers.IO)

    fun getAddDevice(param : DeviceEntityItem) = flow {
        emit(apiService.getAddDevice(param))
    }.flowOn(Dispatchers.IO)

}